#ifndef CHESS_H
#define CHESS_H

#include <QObject>
#include <QWidget>

class Chess:public QWidget
{
    Q_OBJECT

public:
    explicit Chess(QWidget *parent=0);
    ~Chess();

    void send_emit();
    int getChessBoard(int x,int y);
    void setChessBoard(int x,int y,int value);
    bool deleteChessBoardXY();
    void addChessBoardXY(int x,int y);
    void clearChessBoard();
    void setStep(int step);
    int getStep();
    void setWhoWin(int);
    bool isWin(int row, int col);
    void gameOver(int ,int);

signals:
    void start_emit(int,int,int);
    void postresult_emit(int,int);
private:
    int whoWin;
    int moveX,moveY;
    int preX,preY;      //上一步
    int step;            //步数
    void paintEvent(QPaintEvent *);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    std::vector<int> chessBoardX;               //记录步数的X
    std::vector<int> chessBoardY;               //记录仪步数的Y
};

#endif // CHESS_H
